#pragma once

#include "tcpserver.hpp"

void Usage(char* proc)
{
    std::cerr<<"Usage ::"<<proc<<" port"<<std::endl;
}
int main(int argc,char* argv[])
{
    if(argc!=2)
    {
        Usage(argv[0]);
        exit(USAGE_ERR);
    }
    uint16_t  port=std::stoi(argv[1]);
    //设置日志向控制台打印
    Enable_Console_Log_Strategy();

    //开启日志，默认向控制台打印
    std::unique_ptr<tcpserver> tsvs=std::make_unique<tcpserver>(port);
    tsvs->init();
    tsvs->run();
    
    return 0;
}